/*
 *  $Id: Health.cs 975 2009-12-16 17:13:22Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Affects {
    /// <summary>
    /// Эффект: изменение минимального здоровья
    /// Параметры: значение
    /// </summary>
    public class ModMinHealth: Affect {
        public readonly int Value;

        public ModMinHealth(int value) {
            Value = value;
        }

        public override string Id {
            get { return "health.min"; }
        }
        public override string NameText {
            get { return Name.GetText(-Value); }
        }

        public override int BaseWeight {
            get { return Value * -10; }
        }

        public override Affect Clone() {
            return new ModMinHealth(Value);
        }

        public override void SetAffect() {
            base.SetAffect();
            LocalSummary.ChangeMinHealth(Value);
        }
        public override void ResetAffect() {
            base.ResetAffect();
            LocalSummary.ChangeMinHealth(-Value);
        }
    }

    /// <summary>
    /// Эффект: изменение минимального здоровья
    /// Параметры: значение
    /// </summary>
    public class ModMaxHealth: Affect {
        public readonly int Value;

        public ModMaxHealth(int value) {
            Value = value;
        }

        public override string Id {
            get { return "health.max"; }
        }
        public override string NameText {
            get { return Name.GetText(Value); }
        }

        public override int BaseWeight {
            get { return Value * WeightCoeff.Health; }
        }

        public override Affect Clone() {
            return new ModMaxHealth(Value);
        }

        public override void SetAffect() {
            base.SetAffect();
            LocalSummary.ChangeMaxHealth(Value);
        }
        public override void ResetAffect() {
            base.ResetAffect();
            LocalSummary.ChangeMaxHealth(-Value);
        }
    }
}
